package cn.com.egova.bouncingmenu;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.util.AttributeSet;
import android.widget.FrameLayout;

/**
 * Created by yuanchao on 2017/4/16.
 */

public class BouncingMenuLayout extends FrameLayout {
    public BouncingMenuLayout(Context context) {
        this(context,null);
    }

    public BouncingMenuLayout(Context context, AttributeSet attrs) {
        this(context, attrs,0);
    }

    public BouncingMenuLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context,attrs);
    }

    private void init(Context context,AttributeSet attrs) {
        TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.bouncingMenuLayout);
        int maxArcHeight = typedArray.getDimensionPixelOffset(R.styleable.bouncingMenuLayout_childMaxArcHeight, 100);
        int bgColor = typedArray.getColor(R.styleable.bouncingMenuLayout_childBouncingbg, Color.WHITE);

        BouncingView bv = new BouncingView(context,maxArcHeight,bgColor);
//        bv.setMaxArcHeight(maxArcHeight);
//        bv.setBgColor(bgColor);
        this.addView(bv);
    }

}
